import const
import math
MAXSKILLLEVEL = 5

def GetSkillPointsPerMinute(primaryAttributeValue, secondaryAttributeValue):
    pointsPerMinute = (primaryAttributeValue + (secondaryAttributeValue / 2.0))
    return pointsPerMinute



def GetSPForLevelRaw(skillTimeConstant, level):
    skillTimeConstant = (skillTimeConstant * const.skillPointMultiplier)
    if (level <= 0):
        return 0
    else:
        if (level > MAXSKILLLEVEL):
            level = MAXSKILLLEVEL
        ret = (skillTimeConstant * (2 ** (2.5 * (level - 1))))
        return int(math.ceil(ret))


exports = {'skillUtil.GetSkillPointsPerMinute': GetSkillPointsPerMinute,
 'skillUtil.GetSPForLevelRaw': GetSPForLevelRaw,
 'skillUtil.MAXSKILLLEVEL': MAXSKILLLEVEL}

